<?php 
namespace app\tree\controller;
use app\tree\service\PlantService;
use think\Request;
use think\facade\Log;
/**
 * @title 种植
 * @description 种植树
* @group 树
 */
class Plant extends PlantService
{
	/**
     * @title 所有可种植树列表
     * @description 树列表
 
     * @author 凌杰
     * @url /tree/plant/tree_lists
     * @method POST
     * @param name:limit type:int require:0 default:'10' other: desc:每页数据量
     * @param name:page type:int require:0 default:'1' other: desc:页数
     * @return code:错误码
     * @return msg:错误消息
     * @return list:树列表@
     * @list treesid:树id treesname:树名称 energy:树能量 treesimg:树图片 prizename:奖品名称 prizeid:奖品id,treesuserid:treesuserid
     */
    public function tree_lists(Request $request)
    {
        if(!$request->isPost()) return False;
        $info=$request->param();
        $res = $this->tree_list($info);
        return json($res);
    }

  /**
     * @title 种植树
     * @description 种植树
     * @author 凌杰
     * @url /tree/plant/plant_tree
     * @method POST
     * @param name:treesid type:int require:1 default: other: desc:树的id
     * @param name:Token type:string require:1 default: other: desc:种植当前树的家庭token
     * @return code:错误码
     * @return msg:错误消息
     */
    public function plant_tree(Request $request){
        if(!$request->isPost()) return False;
        $info=$request->param();
        $res = $this->tree_planting($info);
        return json($res);
    }

     /**
     * @title 通过token查看家庭树
     * @description 查看家庭树

     * @author 凌杰
     * @url /tree/plant/select_tree
     * @param name:Token type:string require:1 default:'' other: desc:家庭token
  
     * @method POST
     * @return code:错误码
     * @return msg:错误消息
     */
    public function select_tree(Request $request){
        if(!$request->isPost()) return False;
        $info=$request->param();
        $res = $this->find_tree($info);
        return json($res);
    }

}

?>